package t327.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class ViewController {
    
    @RequestMapping("toMain")
    public String toMain(){
    return "main";
}
    @RequestMapping("toHome")
    public String toHome(){
        return "home";
    }
    @RequestMapping("toExpendAndIncomeTitle")
    public String toExpendAndIncomeTitle(){
        return "finance/expendAndIncomeTitle";
    }
    @RequestMapping("toExpend")
    public String toExpend(){
        return "finance/expend";
    }
    @RequestMapping("toIncome")
    public String toIncome(){
        return "finance/income";
    }
    @RequestMapping("toGetAlliList")
    public String toGetAlliList(){
        return "finance/getAlleiList";
    }
    //合同给页面
    @RequestMapping("toContract")
    public String toContract(){
    return "contract/InitialContract";
    }
    @RequestMapping("toshowcontract")
    public String toshowcontract(){
        return "contract/showcontract";
    }
    @RequestMapping("toOrderEntryList")
    public String OrderEntryList(){
        return "OrderGoods/OrderEntry";
    }
    @RequestMapping("tosearch")
    public String search(){
        return "OrderGoods/search";
    }

    //报价单录入页面
    @RequestMapping("toQuotationEntering")
    public String toQuotationEntering(){
        return "quote/quotation";
    }
    @RequestMapping("toQuotationList")
    public String toQuotationList(){return "quote/quotationList";} //报价单列表

    @RequestMapping("toaddstaff")
    public String toaddstaff(){
        return "staff/addstaff";
    }
    @RequestMapping("todisplaypersonnel")
    public String todisplaypersonnel(){
        return "staff/displaypersonnel";
    }
    //客户模块页面
    @RequestMapping("toclient")
    public String toclient(){
        return "client/customers";
    }
    @RequestMapping("toclientlist")
    public String toclientlist(){
        return "client/clientList";
    }
    //裁剪
    @RequestMapping("tocuttingDepartment")
    public String tocuttingDepartment(){
        return "tailor/cuttingDepartment";
    }
    @RequestMapping("tomanufacturingPlanSheet")
    public String tomanufacturingPlanSheet(){
        return "tailor/manufacturingPlanSheet";
    }
    @RequestMapping("toMaterialApplications")
    public String toMaterialApplications(){
        return "tailor/MaterialApplication";
    }

    //仓库
    @RequestMapping("toWarehouseInfo")
    public String toWarehouseInfo(){
        return "warehouse/warehouseInfo";
    }
    @RequestMapping("toAddWarehouse")
    public String toAddWarehouse(){
        return "warehouse/addWarehouse";
    }
    //    仓库物料出入库
    @RequestMapping("toWrehousehome")
    public String toWrehousehome(){
        return "warehouse/warehousehome";
    }
    //    出库
    @RequestMapping("toWrehousechu")
    public String toWrehousechu(){
        return "warehouse/chu";
    }
    //    入库
    @RequestMapping("toWrehouseru")
    public String toWrehouseru(){
        return "warehouse/ru";
    }
    //    物料审核
    @RequestMapping("toAudit")
    public String  toAudit(){
        return "warehouse/materialsAudit";
    }


    //生产模块
    @RequestMapping("toSampleSheetList")
    public String toSampleSheetList(){ return "manufacture/technicalDivision/sampleSheetList"; }//样板单列表
    @RequestMapping("toSampleOrderReviewList")
    public String toSampleOrderReviewList(){ return "manufacture/technicalDivision/SampleOrderReviewList"; }//样板单审核列表
    @RequestMapping("toAddSampleSheet")
    public String toAddSampleSheet(){ return "manufacture/technicalDivision/addSampleSheet"; }//添加样板单
    @RequestMapping("toSampleSheetDetails")
    public String toSampleSheetDetails(){ return "manufacture/technicalDivision/sampleSheetDetails"; }//样板单详情
    @RequestMapping("toSampleOrderReviewDetails")
    public String toSampleOrderReviewDetails(){ return "manufacture/technicalDivision/SampleOrderReviewDetails"; }//样板单审核详情
    @RequestMapping("toStyleNumberList")
    public String toStyleNumberList(){ return "manufacture/technicalDivision/StyleNumberList"; }//款号列表
    @RequestMapping("toAddStyleNumber")
    public String toAddStyleNumber(){ return "manufacture/technicalDivision/addStyleNumber"; }//款号列表
    @RequestMapping("toSampleSheetDetail")//根据样板单号查询详细信息
    public String  toSampleSheetDetail(HttpServletRequest request, Long sampleSheetId){
        HttpSession session = request.getSession();
        session.setAttribute("sampleSheetId",sampleSheetId);
        System.out.println("-=-=-=-");
        System.out.println(sampleSheetId);
        System.out.println("-=-=-=-");
        return "manufacture/technicalDivision/sampleSheetDetails";
    }
    @RequestMapping("toCreateSampleSheet")//款号列表创建样板单
    public String  toCreateSampleSheet(HttpServletRequest request, Long styleNumberId){
        HttpSession session = request.getSession();
        session.setAttribute("styleNumberId",styleNumberId);
        System.out.println("-=-=-=-");
        System.out.println(styleNumberId);
        System.out.println("-=-=-=-");
        return "manufacture/technicalDivision/addSampleSheet";
    }

    @RequestMapping("toRedactSampleSheet")//款号列表创建样板单
    public String  toRedactSampleSheet(HttpServletRequest request, Long styleNumberId){
        HttpSession session = request.getSession();
        session.setAttribute("styleNumberId",styleNumberId);
        System.out.println("-=-=-=-");
        System.out.println(styleNumberId);
        System.out.println("-=-=-=-");
        return "manufacture/technicalDivision/redactSampleSheet";
    }



    @RequestMapping("toQualityTesting")
    public String toQualityTesting(){ return "productAdmin/qualityTestingPart"; }//质检生产计划
    @RequestMapping("toAddQualityTesting")
    public String toAddQualityTesting(){ return "productAdmin/addQuaTesting"; }//质检结果添加
    @RequestMapping("toMaterial")
    public String toMaterial(){ return "productAdmin/toMaTerial"; }//申请物料

    @RequestMapping("toPlanList")
    public String toPlanList(){
        return "plan/plan";
    }
    @RequestMapping("toPlanadd")
    public String toPlanadd(){
        return "plan/planadd";
    }

    //缝纫
    @RequestMapping("toSewingList")
    public String toSewingList(){
        return "SewingDepartment/sewingList";
    }
    @RequestMapping("toAddSewing")
    public String toAddSewing(){
        return "SewingDepartment/addSewing";
    }

    @RequestMapping("toMaterialApplication")
    public String toMaterialApplication(){
        return "SewingDepartment/MaterialApplication";
    }
    //人员添加页面
    @RequestMapping("toUpdatestaff")
    public ModelAndView toaddstfaf(ModelAndView modelAndView, HttpServletRequest request){
        request.setAttribute("id", "id");
        modelAndView.addObject("id", "id");
        modelAndView.setViewName("staff/updatestaff");
        return modelAndView;
    }
    //人脸跳转
    @RequestMapping("toPaizhao")
    public ModelAndView toPaizhao(ModelAndView modelAndView, HttpServletRequest request){
        modelAndView.setViewName("staff/paizhao");
        return modelAndView;
    }
    //打卡表跳转
    @RequestMapping("toPushCard")
    public ModelAndView toPushCard(ModelAndView modelAndView, HttpServletRequest request){
        modelAndView.setViewName("staff/pushcard");
        return modelAndView;
    }
//    物料出入库
    @RequestMapping("toMaterialStore")
    public String toMaterialStore(){
        return "materialsStore/warehouse";
    }

    @RequestMapping("toDefectiveList")
    public String toDefectiveList(){
        return "warehouse/Defective/defectiveList"; }

    @RequestMapping("toAudt")
    public String toAudi(){
        return "Audit/AuditList";}

    @RequestMapping("toreview")
    public String toreview(){
        return "Audit/review";}

    //扫车牌
    @RequestMapping("toPlateNumberScan")
    public String toPlateNumberScan(){
        return "plateNumberScan/plateNumberScan";
    }
     @RequestMapping("topaycontract")
    public String toPaycontract(){
        return "contractPayment/paycontract";
    }
    //报销申请
    @RequestMapping("toReimbursement")
    public String toReimbursement(){
        return "staff/reimbursementApplication";
    }

    @RequestMapping("toproof")
    public String toproof(){
        return "Audit/proof";
    }

}
